package com.jewel.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jewel.mapper.BannerMapper;
import com.jewel.pojo.Banner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements IBannerService {
    @Autowired
    private BannerMapper mapper;


    @Override
    public List<Banner> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Banner getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(Banner banner) {
        return mapper.insert(banner);
    }

    @Override
    public Integer update(Banner banner) {
        return mapper.updateById(banner);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
